<template>
	<view class="setting">
		<u-cell-group style="background-color: #fff;">
			<u-cell size="large" title="定向推送" isLink @click="ToPush"></u-cell>
			<u-cell size="large" title="关于我们" isLink @click="detail(2,'关于我们')"></u-cell>
			<u-cell size="large" title="服务协议" isLink @click="detail(7,'服务协议')"></u-cell>
			<u-cell size="large" title="隐私政策" isLink @click="detail(3,'隐私政策')"></u-cell>
			<u-cell size="large" title="注销" isLink @click="writeOff"></u-cell>
		</u-cell-group>
		<view class="btn" @click="layout">退出</view>
		<view class="other">半柿</view>
		<view class="other">Copyright ©2022 湖北游趣时代网络科技有限公司</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods:{
			writeOff(){
				uni.$u.toast('已申请注销');
			},
			ToPush(){
				uni.navigateTo({
					url:'/pages/my/fixedPush'
				})
			},
			layout() {
				uni.$u.http.post('/user/logout').then((res) => {
					if (res.code === 1) {
						uni.removeStorageSync('token');
						uni.removeStorageSync('userinfo');
						uni.$u.toast('退出登录');
						uni.reLaunch({
							url: '/pages/index/index'
						});
					}
				}).catch(() => {
				
				})
			},
			detail(type,title){
				uni.$u.route({
					url: 'pages/my/setting/article',
					params: {
						type: type,
						title: title
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		height: 100%;
	}

	.setting {
		height: 100%;
		background-color: #f6f6f6;
		.btn{
			margin: 100rpx 30rpx 100rpx;
			height: 90rpx;
			border-radius: 45rpx;
			font-size: 32rpx;
			color: #FFC141;
			border: 1px solid #FFDF41;
			display: flex;
			align-items: center;
			justify-content: center;
			font-weight: bold;
		}
		.other{
			text-align: center;
			color: #666;
		}
	}
</style>
